<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>订单列表</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="content-type" content="text/html;charset=utf-8">

<link rel="stylesheet" type="text/css"
	href='<c:url value="/uikit-2.25.0/css/uikit.min.css"/>'>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript"
	src='<c:url value="/uikit-2.25.0/js/uikit.min.js"/>'></script>
<style type="text/css">
<
style type ="text/css">* {
	font-size: 11pt;
}

div {
	border: solid 2px gray;
	width: 75px;
	height: 75px;
	text-align: center;
}

li {
	margin: 10px;
}

#buy {
	background: url(< c : url value = '/images/all.png'/ >) no-repeat;
	display: inline-block;
	background-position: 0 -902px;
	margin-left: 30px;
	height: 36px;
	width: 146px;
}

#buy:HOVER {
	background: url(< c : url value = '/images/all.png'/ >) no-repeat;
	display: inline-block;
	background-position: 0 -938px;
	margin-left: 30px;
	height: 36px;
	width: 146px;
}
</style>
</head>

<body>
	<h2 class="uk-text-center uk-text-muted uk-text-warning  uk-margin-top">我的订单</h2>

	<table border="1" width="100%" cellspacing="0" background="black"
		class="uk-table uk-table-hover">
		<c:forEach items="${orderLists }" var="order">
			<tr bgcolor="gray" bordercolor="#ccc">
				<td colspan="6">订单编号：${ order.oid } 成交时间：${order.ordertime }
					金额：<b class="uk-text-muted uk-text-danger">${ order.total }</b> <!-- 
							用户的订单状态
							1、付款款			显示：付款
							2、已付款，未发货		显示：等待发货
							3、已发货，未确认		显示：确认收获
							4、已确认收货		显示：订单完成
				 		--> <c:choose>
						<c:when test="${ order.state ==1}">
							<a
								href="${pageContext.request.contextPath }/orderServlet?method=findByOid&oid=${order.oid}">付款</a> 等待发货</c:when>
						<c:when test="${ order.state ==2}">等待发货</c:when>
						<c:when test="${ order.state ==3}">
							<a href="javascript:alert('已确认收货！');">确认收货</a>
						</c:when>
						<c:otherwise>
							<c:out value="订单完成"></c:out>
						</c:otherwise>

					</c:choose>
				</td>
			</tr>


			<c:forEach items="${ order.orderItems }" var="orderItem">

				<tr bordercolor="gray" align="center">
					<td width="15%">
						<div>
							<img src='<c:url value="/${ orderItem.book.image}"/>' height="75" />
						</div>
					</td>
					<td class="uk-text-center uk-text-middle">书名：${ orderItem.book.bname }</td>
					<td class="uk-text-center uk-text-middle">单价：${ orderItem.book.price }元</td>
					<td class="uk-text-center uk-text-middle">作者：${ orderItem.book.author }</td>
					<td class="uk-text-center uk-text-middle">数量：${ orderItem.count }</td>
					<td class="uk-text-center uk-text-middle">小计：${ orderItem.subtotal }元</td>
				</tr>
			</c:forEach>
		</c:forEach>


	</table>
</body>
</html>
